package com.wuba.rxjavademo.tzx.create;

import com.wuba.rxjavademo.tzx.common.Base;

import java.util.ArrayList;
import java.util.List;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by tanzhenxing
 * Date: 2016/6/24.
 * Description:
 * just：序列发射
 */
public class RxJust extends Base {
    public static void main(String [] args) throws InterruptedException {
        init();
    }

    public static void init() {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        List<Integer> list1 = new ArrayList<>();
        list1.add(4);
        list1.add(5);
        list1.add(6);
        Observable.just(list1,list)
                  .subscribe(new Subscriber<List<Integer>>() {
                      @Override
                      public void onCompleted() {

                      }

                      @Override
                      public void onError(Throwable e) {

                      }

                      @Override
                      public void onNext(List<Integer> integers) {
                          for (Integer integer:integers) {
                              print(String.valueOf(integer));
                          }
                      }
                  });
    }


}
